<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>木投网--商城--详情</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_now.css">
	<link rel="stylesheet" href="/resource/css/mt_showBo.css">
</head>
<body>
@include('common.shop_head')
<!-- 现货资源 -->
@foreach($data as $data1)
<div class="now-resource main">
	<div class="now-left left">
		<div class="title">当前位置：
			<a href="javascript:;">首页</a>&#62<a href="javascript:;">商城</a>&#62
			<a href="javascript:;">{{$data1->product_name}}</a>
		</div>
		<div class="res-info">
			<div class="info-img left">
				<div class="img-booth">
					<img src="{{$data1->product_img}}" alt="">
				</div>
				<ul class="img-thumb">
					<li class="active"><img src="{{$data1->show_img1}}" alt=""></li>
					<li><img src="{{$data1->show_img2}}" alt=""></li>
					<li><img src="{{$data1->show_img3}}" alt=""></li>
				</ul>
				<ul class="info-arrow">
					<li class="pre"></li>
					<li class="next"></li>
				</ul>
				<span>商品编号：{{$data1->product_sn}}</span>
			</div>
			<div class="info-font left">
				<h2 class="til">{{$data1->product_name}}</h2>
				<div class="price">价格：<span>￥<i>{{$data1->price}}</i>/{{$data1->unit}}</span></div>
				<ul class="font-details">
					<li>规 &#160; 格：<span>{{$data1->spec}}</span></li>
					<li>材 &#160; 质：<span>{{$data1->quality}}</span></li>
					<li>库存量：<span>{{$data1->stock}}</span></li>
				</ul>
				<form action="shop_add_cart" method="post">
					<input type="hidden" value="{{$data1->product_id}}" id="product_id">
					<ul class="contact-info">
						<li>
							<div class="left"><span>采购数量：</span></div>
							<div class="info-num left">
								<a href="javascript:;" class="pre"></a>
								<input type="text" id="info-num" value="1" class="number">
								<a href="javascript:;" class="next"></a>
							</div>
						</li>
					</ul>
					<div class="info-shopping">
						@if(empty(session_get(UserEnum::USER_INFO_USER_ID)))
							<div class="a">
								<i></i><input type="button" value="加入购物车">
							</div>
							<div class="a">
								<a href="/shop_cart_list">查看购物车</a>
							</div>
							<script src="/resource/js/jquery-1.11.3.min.js"></script>
							<script>
								//登录
								$('.info-shopping .a').click(function(){
									loginShow();
								});
								function loginShow(){
									$('.popup-login').show();
									$('.popup').show();
								}
							</script>
						@else
							<div class="a">
								<i></i><input type="button" value="加入购物车">
							</div>
							<div class="a">
								<a href="javascript:;">查看购物车</a>
							</div>

						@endif
					</div>
				</form>
			</div>
		</div>
		<div class="res-illustrate">
			<div class="til">
				<span>商品说明</span>
			</div>
			<div class="ill-p">
				{{$data1->brief}}
			</div>
		</div>
	</div>
	<div class="now-right left">
		<div class="classify-right">
			<div class="til">推广商品</div>
			<div class="emphases-box">
				<div class="floor-shop">
					<div class="shop-img">
						<a href="javascript:;"><img src="img/floor_shop_1.png" alt=""></a>
					</div>
					<div class="shop-info">
						<a href="javascript:;" class="name"><span>实木地板</span></a>
						<div class="price">￥500.00/立方米</div>
					</div>
				</div>
				<div class="floor-shop">
					<div class="shop-img">
						<a href="javascript:;"><img src="img/floor_shop_2.jpg" alt=""></a>
					</div>
					<div class="shop-info">
						<a href="javascript:;" class="name"><span>实木地板</span></a>
						<div class="price">￥500.00/立方米</div>
					</div>
				</div>
				<div class="floor-shop">
					<div class="shop-img">
						<a href="javascript:;"><img src="img/floor_shop_3.jpg" alt=""></a>
					</div>
					<div class="shop-info">
						<a href="javascript:;" class="name"><span>实木地板</span></a>
						<div class="price">￥500.00/立方米</div>
					</div>
				</div>
				<div class="floor-shop">
					<div class="shop-img">
						<a href="javascript:;"><img src="img/floor_shop_1.png" alt=""></a>
					</div>
					<div class="shop-info">
						<a href="javascript:;" class="name"><span>实木地板</span></a>
						<div class="price">￥500.00/立方米</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
@endforeach
@include('common.shop_foot')
<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script src="/resource/js/mt_showBo.js"></script>  <!-- 提示信息 -->
<script>
	//导航 商品全部 隐藏显示
	var $allW = $('.all-wrap');
	$allW.hide();
	$('.nav .nav-all').attr('rel','hide');
	$('.nav .nav-all').click(function(){
		if($(this).attr('rel') == 'hide'){
			$(this).attr('rel','show');
			$allW.show();
		}else{
			$(this).attr('rel','hide');
			$allW.hide();
		};		
	});


		//点击提示成功加入购物车
	$('.info-shopping .a input').click(function(){
		var product_id = $("#product_id").val();
		var number = $(".number").val();
		$.ajax({
			url: "/shop_add_cart",
			type: "POST",
			data: "product_id=" + product_id+"&number="+number,
			success: function (msg) {
					if(msg){
						Showbo.Msg.amend('<img class="left" src="/resource/img/reg_success.png" alt=""><span style="float:left;line-height:72px;">加入购物车成功!</span>',function(btn){
							if (btn == 'yes') {
								window.location.href = '/shop_cart_list';
							}else{
								return false;
							};
						},'查看购物车');
						$('#dvMsgBox input.btn').css('width','100px');
						$('#dvMsgClose').css({
							'display':'block',
							'left': '450px',
							'top': '14px',
							'width': '25px',
							'height': '25px',
							'background': 'url(/resource/img/index_pic.png) no-repeat -163px -376px',
							'border':'none'
						});
					}
			}
		})

	});

</script>
</body>
</html>